package com.njupt.simulation.utils;

public class Caculatepolarizationower {

    public static double calculatepolarization(double pt,String polarizationtype1, String polarizationtype2){
        double pt0 = 0;
        if("zuoxuan".equals(polarizationtype1)) {
            switch (polarizationtype2) {
                case "zuoxuan":
                    pt0 = pt;
                    break;
                case "youxuan":
                    pt0 = pt - 20;
                    break;
                case "chuizhi":
                case "+45xiejihua":
                case "shuiping":
                case "-45xiejihua":
                    pt0 = pt - 3;
                    break;
            }
        }else if("youxuan".equals(polarizationtype1)){
            switch (polarizationtype2) {
                case "zuoxuan":
                    pt0 = pt-20;
                    break;
                case "youxuan":
                    pt0 = pt;
                    break;
                case "chuizhi":
                case "-45xiejihua":
                case "shuiping":
                case "+45xiejihua":
                    pt0 = pt - 3;
                    break;
            }
        }else if("chuizhi".equals(polarizationtype1)){
            switch (polarizationtype2) {
                case "zuoxuan":
                case "+45xiejihua":
                case "-45xiejihua":
                    pt0 = pt-3;
                    break;
                case "youxuan":
                    pt0 = pt - 3;
                    break;
                case "chuizhi":
                    pt0 = pt;
                    break;
                case "shuiping":
                    pt0 = pt - 20;
                    break;
            }
        }else if("shuiping".equals(polarizationtype1)){
            switch (polarizationtype2) {
                case "zuoxuan":
                case "+45xiejihua":
                case "-45xiejihua":
                case "youxuan":
                    pt0 = pt-3;
                    break;
                case "chuizhi":
                    pt0 = pt - 20;
                    break;
                case "shuiping":
                    pt0 = pt;
                    break;
            }
        }
            return pt0;
    }
}